﻿#pragma once

#include "src/bend/dao/daologinfo.h"
#include <QObject>
#define MDB ManDB::instance()
class ManDB : public QObject
{
    Q_OBJECT

public:
    explicit ManDB(QObject* parent = nullptr);
    static ManDB* instance();
    void          init();
    void          saveLoginInfo(const QString& name, const QString& id, const QString& key,
                                const QString& remark);
    void          removeLoginInfo(const QString& id);

    int         indexOfLoginInfo(const QString& secretId);
    QStringList loginNameList();
    LoginInfo   loginInfoByName(const QString& name);
    ~ManDB();

private:
    DaoLoginInfo     m_daoLoginInfo;
    QList<LoginInfo> m_loginfoList;
};
